package com.deer.wms.project.root.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Getter;
import lombok.Setter;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @author : wei
 * @since : 2021-07-27 16:48:37
 **/
@Getter
@Setter
public abstract class BaseEntity implements Serializable {

    private static final long serialVersionUID = 5502203111461882659L;

    /**
     * 主键ID
     */
    @Id
    @TableId(type = IdType.AUTO)
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected Integer id;

    /**
     * 创建人
     */
    protected Integer createUserId;

    /**
     * 创建时间
     */
    @TableField(fill = FieldFill.INSERT)
    protected LocalDateTime createTime;

    /**
     * 修改人
     */
    protected Integer modifyUserId;

    /**
     * 修改时间
     */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    protected LocalDateTime modifyTime;

    /**
     * 预留字段1
     */
    protected String uda1;

    /**
     * 预留字段2
     */
    protected String uda2;

    /**
     * 预留字段3
     */
    protected String uda3;

}
